--
-- PostgreSQL database dump
--

-- Started on 2010-07-15 15:31:29

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 1954 (class 1262 OID 26578)
-- Name: hegeprosoft; Type: DATABASE; Schema: -; Owner: postgres
--

CREATE DATABASE hegeprosoft WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'Spanish_Colombia.1252' LC_CTYPE = 'Spanish_Colombia.1252';


ALTER DATABASE hegeprosoft OWNER TO postgres;

\connect hegeprosoft

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 364 (class 2612 OID 16386)
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--

CREATE PROCEDURAL LANGUAGE plpgsql;


ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;

SET search_path = public, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 1551 (class 1259 OID 26603)
-- Dependencies: 3
-- Name: actividad; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE actividad (
    act_idactividad integer NOT NULL,
    act_nombreactividad character varying(30) NOT NULL,
    act_metodologia character varying(20),
    act_fase integer NOT NULL,
    act_descripcion character varying(500)
);


ALTER TABLE public.actividad OWNER TO postgres;

--
-- TOC entry 1567 (class 1259 OID 26681)
-- Dependencies: 3 1551
-- Name: actividad_act_idactividad_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE actividad_act_idactividad_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.actividad_act_idactividad_seq OWNER TO postgres;

--
-- TOC entry 1957 (class 0 OID 0)
-- Dependencies: 1567
-- Name: actividad_act_idactividad_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE actividad_act_idactividad_seq OWNED BY actividad.act_idactividad;


--
-- TOC entry 1958 (class 0 OID 0)
-- Dependencies: 1567
-- Name: actividad_act_idactividad_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('actividad_act_idactividad_seq', 8, true);


--
-- TOC entry 1552 (class 1259 OID 26609)
-- Dependencies: 3
-- Name: artefactos; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE artefactos (
    art_idartefacto integer NOT NULL,
    art_nombreartefacto character varying(20) NOT NULL,
    art_metodologia character varying(20),
    art_actividad integer NOT NULL,
    art_descripcion character varying(500)
);


ALTER TABLE public.artefactos OWNER TO postgres;

--
-- TOC entry 1568 (class 1259 OID 26683)
-- Dependencies: 3 1552
-- Name: artefactos_art_idartefacto_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE artefactos_art_idartefacto_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.artefactos_art_idartefacto_seq OWNER TO postgres;

--
-- TOC entry 1959 (class 0 OID 0)
-- Dependencies: 1568
-- Name: artefactos_art_idartefacto_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE artefactos_art_idartefacto_seq OWNED BY artefactos.art_idartefacto;


--
-- TOC entry 1960 (class 0 OID 0)
-- Dependencies: 1568
-- Name: artefactos_art_idartefacto_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('artefactos_art_idartefacto_seq', 7, true);


--
-- TOC entry 1578 (class 1259 OID 26836)
-- Dependencies: 3
-- Name: configuracioncursoactividad; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE configuracioncursoactividad (
    cfc_curso character varying(12) NOT NULL,
    cfc_actividad integer NOT NULL,
    cfc_rolesactividad character varying(50),
    cfc_fechaentregaactividad timestamp without time zone,
    cfc_descripcionactividad character varying(900),
    cfc_idactividad integer NOT NULL,
    cfc_secuenciaactividad integer
);


ALTER TABLE public.configuracioncursoactividad OWNER TO postgres;

--
-- TOC entry 1583 (class 1259 OID 26886)
-- Dependencies: 3 1578
-- Name: configuracioncursoactividad_cfc_idactividad_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE configuracioncursoactividad_cfc_idactividad_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.configuracioncursoactividad_cfc_idactividad_seq OWNER TO postgres;

--
-- TOC entry 1961 (class 0 OID 0)
-- Dependencies: 1583
-- Name: configuracioncursoactividad_cfc_idactividad_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE configuracioncursoactividad_cfc_idactividad_seq OWNED BY configuracioncursoactividad.cfc_idactividad;


--
-- TOC entry 1962 (class 0 OID 0)
-- Dependencies: 1583
-- Name: configuracioncursoactividad_cfc_idactividad_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('configuracioncursoactividad_cfc_idactividad_seq', 8, true);


--
-- TOC entry 1579 (class 1259 OID 26842)
-- Dependencies: 3
-- Name: configuracioncursoartecfacto; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE configuracioncursoartecfacto (
    cfc_curso character varying(12) NOT NULL,
    cfc_artefacto integer NOT NULL,
    cfc_rolesartefacto character varying(50),
    cfc_fechaentregaartefacto timestamp without time zone,
    cfc_descripcionartefacto character varying(900),
    cfc_idartefacto integer NOT NULL,
    cfc_secuenciaartefactos integer
);


ALTER TABLE public.configuracioncursoartecfacto OWNER TO postgres;

--
-- TOC entry 1582 (class 1259 OID 26865)
-- Dependencies: 3 1579
-- Name: configuracioncursoartecfacto_cfc_idartefacto_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE configuracioncursoartecfacto_cfc_idartefacto_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.configuracioncursoartecfacto_cfc_idartefacto_seq OWNER TO postgres;

--
-- TOC entry 1963 (class 0 OID 0)
-- Dependencies: 1582
-- Name: configuracioncursoartecfacto_cfc_idartefacto_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE configuracioncursoartecfacto_cfc_idartefacto_seq OWNED BY configuracioncursoartecfacto.cfc_idartefacto;


--
-- TOC entry 1964 (class 0 OID 0)
-- Dependencies: 1582
-- Name: configuracioncursoartecfacto_cfc_idartefacto_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('configuracioncursoartecfacto_cfc_idartefacto_seq', 5, true);


--
-- TOC entry 1580 (class 1259 OID 26848)
-- Dependencies: 3
-- Name: configuracioncursofase; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE configuracioncursofase (
    cfc_curso character varying(12) NOT NULL,
    cfc_fase integer NOT NULL,
    cfc_rolesfase character varying(50),
    cfc_fechaentregafase timestamp without time zone,
    cfc_descripcionfase character varying(900),
    cfc_idfase integer NOT NULL,
    cfc_secuenciafase integer
);


ALTER TABLE public.configuracioncursofase OWNER TO postgres;

--
-- TOC entry 1581 (class 1259 OID 26854)
-- Dependencies: 3 1580
-- Name: configuracioncursofase_cfc_idfase_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE configuracioncursofase_cfc_idfase_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.configuracioncursofase_cfc_idfase_seq OWNER TO postgres;

--
-- TOC entry 1965 (class 0 OID 0)
-- Dependencies: 1581
-- Name: configuracioncursofase_cfc_idfase_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE configuracioncursofase_cfc_idfase_seq OWNED BY configuracioncursofase.cfc_idfase;


--
-- TOC entry 1966 (class 0 OID 0)
-- Dependencies: 1581
-- Name: configuracioncursofase_cfc_idfase_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('configuracioncursofase_cfc_idfase_seq', 11, true);


--
-- TOC entry 1553 (class 1259 OID 26624)
-- Dependencies: 3
-- Name: curso; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE curso (
    cur_materia character varying(50) NOT NULL,
    cur_metodologia character varying(30),
    cur_idcurso character varying(12) NOT NULL,
    cur_cedulaprofesor character varying(12)
);


ALTER TABLE public.curso OWNER TO postgres;

--
-- TOC entry 1554 (class 1259 OID 26627)
-- Dependencies: 3
-- Name: estudiante; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE estudiante (
    est_codigoestudiante character varying(10) NOT NULL,
    est_nombreestudiante character varying(30),
    est_apellidoestudiante character varying(30),
    est_grupotrabajo integer NOT NULL,
    est_loginusuario character varying(20) NOT NULL,
    est_cursoestudiante character varying(12) NOT NULL
);


ALTER TABLE public.estudiante OWNER TO postgres;

--
-- TOC entry 1555 (class 1259 OID 26630)
-- Dependencies: 3
-- Name: fase; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE fase (
    fas_idfase integer NOT NULL,
    fas_nombrefase character varying(20) NOT NULL,
    fas_metodologia character varying(30),
    fas_descripcion character varying(500)
);


ALTER TABLE public.fase OWNER TO postgres;

--
-- TOC entry 1569 (class 1259 OID 26685)
-- Dependencies: 3 1555
-- Name: fase_fas_idfase_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE fase_fas_idfase_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.fase_fas_idfase_seq OWNER TO postgres;

--
-- TOC entry 1967 (class 0 OID 0)
-- Dependencies: 1569
-- Name: fase_fas_idfase_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE fase_fas_idfase_seq OWNED BY fase.fas_idfase;


--
-- TOC entry 1968 (class 0 OID 0)
-- Dependencies: 1569
-- Name: fase_fas_idfase_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('fase_fas_idfase_seq', 17, true);


--
-- TOC entry 1556 (class 1259 OID 26636)
-- Dependencies: 3
-- Name: grupotrabajo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE grupotrabajo (
    grt_idgrupotrabajo integer NOT NULL,
    grt_nombregrupotrabajo character varying(20) NOT NULL,
    grt_curso character varying(10) NOT NULL,
    grt_notadefinitiva integer
);


ALTER TABLE public.grupotrabajo OWNER TO postgres;

--
-- TOC entry 1570 (class 1259 OID 26687)
-- Dependencies: 3 1556
-- Name: grupotrabajo_grt_idgrupotrabajo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE grupotrabajo_grt_idgrupotrabajo_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.grupotrabajo_grt_idgrupotrabajo_seq OWNER TO postgres;

--
-- TOC entry 1969 (class 0 OID 0)
-- Dependencies: 1570
-- Name: grupotrabajo_grt_idgrupotrabajo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE grupotrabajo_grt_idgrupotrabajo_seq OWNED BY grupotrabajo.grt_idgrupotrabajo;


--
-- TOC entry 1970 (class 0 OID 0)
-- Dependencies: 1570
-- Name: grupotrabajo_grt_idgrupotrabajo_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('grupotrabajo_grt_idgrupotrabajo_seq', 13, true);


--
-- TOC entry 1557 (class 1259 OID 26639)
-- Dependencies: 3
-- Name: material; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE material (
    idmaterial integer NOT NULL,
    mat_nombrematerial character varying(255) NOT NULL,
    mat_ruta character varying(90) NOT NULL,
    mat_descripcionmaterial character varying(500),
    mat_fasematerial integer,
    mat_artefactomaterial integer,
    mat_actividad integer
);


ALTER TABLE public.material OWNER TO postgres;

--
-- TOC entry 1571 (class 1259 OID 26689)
-- Dependencies: 3 1557
-- Name: material_idmaterial_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE material_idmaterial_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.material_idmaterial_seq OWNER TO postgres;

--
-- TOC entry 1971 (class 0 OID 0)
-- Dependencies: 1571
-- Name: material_idmaterial_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE material_idmaterial_seq OWNED BY material.idmaterial;


--
-- TOC entry 1972 (class 0 OID 0)
-- Dependencies: 1571
-- Name: material_idmaterial_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('material_idmaterial_seq', 19, true);


--
-- TOC entry 1558 (class 1259 OID 26645)
-- Dependencies: 3
-- Name: metodologia; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE metodologia (
    met_id integer NOT NULL,
    met_nombre character varying(50),
    met_descripcion character varying(400)
);


ALTER TABLE public.metodologia OWNER TO postgres;

--
-- TOC entry 1572 (class 1259 OID 26691)
-- Dependencies: 1558 3
-- Name: metodologia_met_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE metodologia_met_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.metodologia_met_id_seq OWNER TO postgres;

--
-- TOC entry 1973 (class 0 OID 0)
-- Dependencies: 1572
-- Name: metodologia_met_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE metodologia_met_id_seq OWNED BY metodologia.met_id;


--
-- TOC entry 1974 (class 0 OID 0)
-- Dependencies: 1572
-- Name: metodologia_met_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('metodologia_met_id_seq', 1, true);


--
-- TOC entry 1559 (class 1259 OID 26648)
-- Dependencies: 3
-- Name: modulo; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE modulo (
    mod_idmodulo integer NOT NULL,
    mod_nombremodulo character varying(20) NOT NULL,
    mod_rutamodulo character varying(200) NOT NULL,
    mod_visible character varying(20),
    mod_padre character varying(50),
    mod_numero character varying(100),
    mod_rol character varying(20)
);


ALTER TABLE public.modulo OWNER TO postgres;

--
-- TOC entry 1573 (class 1259 OID 26693)
-- Dependencies: 1559 3
-- Name: modulo_mod_idmodulo_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE modulo_mod_idmodulo_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.modulo_mod_idmodulo_seq OWNER TO postgres;

--
-- TOC entry 1975 (class 0 OID 0)
-- Dependencies: 1573
-- Name: modulo_mod_idmodulo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE modulo_mod_idmodulo_seq OWNED BY modulo.mod_idmodulo;


--
-- TOC entry 1976 (class 0 OID 0)
-- Dependencies: 1573
-- Name: modulo_mod_idmodulo_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('modulo_mod_idmodulo_seq', 1, false);


--
-- TOC entry 1560 (class 1259 OID 26651)
-- Dependencies: 3
-- Name: permiso; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE permiso (
    pem_idpermiso integer NOT NULL,
    pem_usuario character varying(255) NOT NULL,
    pem_modulo integer NOT NULL,
    mod_tipo character varying(10)
);


ALTER TABLE public.permiso OWNER TO postgres;

--
-- TOC entry 1574 (class 1259 OID 26695)
-- Dependencies: 1560 3
-- Name: permiso_pem_idpermiso_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE permiso_pem_idpermiso_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.permiso_pem_idpermiso_seq OWNER TO postgres;

--
-- TOC entry 1977 (class 0 OID 0)
-- Dependencies: 1574
-- Name: permiso_pem_idpermiso_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE permiso_pem_idpermiso_seq OWNED BY permiso.pem_idpermiso;


--
-- TOC entry 1978 (class 0 OID 0)
-- Dependencies: 1574
-- Name: permiso_pem_idpermiso_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('permiso_pem_idpermiso_seq', 1, false);


--
-- TOC entry 1561 (class 1259 OID 26654)
-- Dependencies: 3
-- Name: profesor; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE profesor (
    prf_cedulaprofesor character varying(12) NOT NULL,
    prf_nombreprofesor character varying(30),
    prf_apellidoprofesor character varying(30),
    prf_loginusuario character varying(10) NOT NULL,
    prf_cursoprofesor character varying(10) NOT NULL
);


ALTER TABLE public.profesor OWNER TO postgres;

--
-- TOC entry 1562 (class 1259 OID 26657)
-- Dependencies: 3
-- Name: reporteentregas; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reporteentregas (
    rpe_idreporte integer NOT NULL,
    rpe_grupotrabajo integer NOT NULL,
    rpe_actividad integer NOT NULL,
    rpe_fecha timestamp without time zone,
    rpe_observcionreporteentrega character varying(500)
);


ALTER TABLE public.reporteentregas OWNER TO postgres;

--
-- TOC entry 1575 (class 1259 OID 26697)
-- Dependencies: 3 1562
-- Name: reporteentregas_rpe_idreporte_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE reporteentregas_rpe_idreporte_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.reporteentregas_rpe_idreporte_seq OWNER TO postgres;

--
-- TOC entry 1979 (class 0 OID 0)
-- Dependencies: 1575
-- Name: reporteentregas_rpe_idreporte_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE reporteentregas_rpe_idreporte_seq OWNED BY reporteentregas.rpe_idreporte;


--
-- TOC entry 1980 (class 0 OID 0)
-- Dependencies: 1575
-- Name: reporteentregas_rpe_idreporte_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('reporteentregas_rpe_idreporte_seq', 1, false);


--
-- TOC entry 1563 (class 1259 OID 26663)
-- Dependencies: 3
-- Name: reportenotas; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE reportenotas (
    rpn_idreportenotas integer NOT NULL,
    rpn_actividad integer NOT NULL,
    rpn_profesor character varying(12) NOT NULL,
    rpn_nota character varying(255),
    rpn_observaciones character varying(500),
    rpn_grupotrabajo integer NOT NULL,
    reporteentrega integer NOT NULL
);


ALTER TABLE public.reportenotas OWNER TO postgres;

--
-- TOC entry 1564 (class 1259 OID 26669)
-- Dependencies: 3
-- Name: roles; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE roles (
    rol_idroles integer NOT NULL,
    rol_nombreroles character varying(20) NOT NULL,
    rol_actividadroles character varying(20),
    rol_descripcionroles character varying(500)
);


ALTER TABLE public.roles OWNER TO postgres;

--
-- TOC entry 1576 (class 1259 OID 26699)
-- Dependencies: 3 1564
-- Name: roles_rol_idroles_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE roles_rol_idroles_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.roles_rol_idroles_seq OWNER TO postgres;

--
-- TOC entry 1981 (class 0 OID 0)
-- Dependencies: 1576
-- Name: roles_rol_idroles_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE roles_rol_idroles_seq OWNED BY roles.rol_idroles;


--
-- TOC entry 1982 (class 0 OID 0)
-- Dependencies: 1576
-- Name: roles_rol_idroles_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('roles_rol_idroles_seq', 1, false);


--
-- TOC entry 1565 (class 1259 OID 26675)
-- Dependencies: 3
-- Name: tipousuario; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tipousuario (
    tpu_id integer NOT NULL,
    tpu_nombre character varying(20) NOT NULL
);


ALTER TABLE public.tipousuario OWNER TO postgres;

--
-- TOC entry 1577 (class 1259 OID 26701)
-- Dependencies: 1565 3
-- Name: tipousuario_tpu_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipousuario_tpu_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.tipousuario_tpu_id_seq OWNER TO postgres;

--
-- TOC entry 1983 (class 0 OID 0)
-- Dependencies: 1577
-- Name: tipousuario_tpu_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipousuario_tpu_id_seq OWNED BY tipousuario.tpu_id;


--
-- TOC entry 1984 (class 0 OID 0)
-- Dependencies: 1577
-- Name: tipousuario_tpu_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('tipousuario_tpu_id_seq', 1, false);


--
-- TOC entry 1566 (class 1259 OID 26678)
-- Dependencies: 3
-- Name: usuario; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE usuario (
    usu_loginusuario character varying(10) NOT NULL,
    usu_contrasenausuario character varying(20) NOT NULL,
    usu_tipousuario character varying(15) NOT NULL
);


ALTER TABLE public.usuario OWNER TO postgres;

--
-- TOC entry 1861 (class 2604 OID 26703)
-- Dependencies: 1567 1551
-- Name: act_idactividad; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE actividad ALTER COLUMN act_idactividad SET DEFAULT nextval('actividad_act_idactividad_seq'::regclass);


--
-- TOC entry 1862 (class 2604 OID 26704)
-- Dependencies: 1568 1552
-- Name: art_idartefacto; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE artefactos ALTER COLUMN art_idartefacto SET DEFAULT nextval('artefactos_art_idartefacto_seq'::regclass);


--
-- TOC entry 1872 (class 2604 OID 26888)
-- Dependencies: 1583 1578
-- Name: cfc_idactividad; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE configuracioncursoactividad ALTER COLUMN cfc_idactividad SET DEFAULT nextval('configuracioncursoactividad_cfc_idactividad_seq'::regclass);


--
-- TOC entry 1873 (class 2604 OID 26867)
-- Dependencies: 1582 1579
-- Name: cfc_idartefacto; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE configuracioncursoartecfacto ALTER COLUMN cfc_idartefacto SET DEFAULT nextval('configuracioncursoartecfacto_cfc_idartefacto_seq'::regclass);


--
-- TOC entry 1874 (class 2604 OID 26856)
-- Dependencies: 1581 1580
-- Name: cfc_idfase; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE configuracioncursofase ALTER COLUMN cfc_idfase SET DEFAULT nextval('configuracioncursofase_cfc_idfase_seq'::regclass);


--
-- TOC entry 1863 (class 2604 OID 26705)
-- Dependencies: 1569 1555
-- Name: fas_idfase; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE fase ALTER COLUMN fas_idfase SET DEFAULT nextval('fase_fas_idfase_seq'::regclass);


--
-- TOC entry 1864 (class 2604 OID 26706)
-- Dependencies: 1570 1556
-- Name: grt_idgrupotrabajo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE grupotrabajo ALTER COLUMN grt_idgrupotrabajo SET DEFAULT nextval('grupotrabajo_grt_idgrupotrabajo_seq'::regclass);


--
-- TOC entry 1865 (class 2604 OID 26707)
-- Dependencies: 1571 1557
-- Name: idmaterial; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE material ALTER COLUMN idmaterial SET DEFAULT nextval('material_idmaterial_seq'::regclass);


--
-- TOC entry 1866 (class 2604 OID 26708)
-- Dependencies: 1572 1558
-- Name: met_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE metodologia ALTER COLUMN met_id SET DEFAULT nextval('metodologia_met_id_seq'::regclass);


--
-- TOC entry 1867 (class 2604 OID 26709)
-- Dependencies: 1573 1559
-- Name: mod_idmodulo; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE modulo ALTER COLUMN mod_idmodulo SET DEFAULT nextval('modulo_mod_idmodulo_seq'::regclass);


--
-- TOC entry 1868 (class 2604 OID 26710)
-- Dependencies: 1574 1560
-- Name: pem_idpermiso; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE permiso ALTER COLUMN pem_idpermiso SET DEFAULT nextval('permiso_pem_idpermiso_seq'::regclass);


--
-- TOC entry 1869 (class 2604 OID 26711)
-- Dependencies: 1575 1562
-- Name: rpe_idreporte; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE reporteentregas ALTER COLUMN rpe_idreporte SET DEFAULT nextval('reporteentregas_rpe_idreporte_seq'::regclass);


--
-- TOC entry 1870 (class 2604 OID 26712)
-- Dependencies: 1576 1564
-- Name: rol_idroles; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE roles ALTER COLUMN rol_idroles SET DEFAULT nextval('roles_rol_idroles_seq'::regclass);


--
-- TOC entry 1871 (class 2604 OID 26713)
-- Dependencies: 1577 1565
-- Name: tpu_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE tipousuario ALTER COLUMN tpu_id SET DEFAULT nextval('tipousuario_tpu_id_seq'::regclass);


--
-- TOC entry 1876 (class 2606 OID 26715)
-- Dependencies: 1551 1551
-- Name: actividad_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY actividad
    ADD CONSTRAINT actividad_pkey PRIMARY KEY (act_idactividad);


--
-- TOC entry 1878 (class 2606 OID 26717)
-- Dependencies: 1552 1552
-- Name: artefactos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY artefactos
    ADD CONSTRAINT artefactos_pkey PRIMARY KEY (art_idartefacto);


--
-- TOC entry 1910 (class 2606 OID 26875)
-- Dependencies: 1579 1579
-- Name: cfc_idartefacto; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY configuracioncursoartecfacto
    ADD CONSTRAINT cfc_idartefacto PRIMARY KEY (cfc_idartefacto);


--
-- TOC entry 1912 (class 2606 OID 26864)
-- Dependencies: 1580 1580
-- Name: cfc_idfase; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY configuracioncursofase
    ADD CONSTRAINT cfc_idfase PRIMARY KEY (cfc_idfase);


--
-- TOC entry 1908 (class 2606 OID 26896)
-- Dependencies: 1578 1578
-- Name: configuracioncursoactividad_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY configuracioncursoactividad
    ADD CONSTRAINT configuracioncursoactividad_pkey PRIMARY KEY (cfc_idactividad);


--
-- TOC entry 1880 (class 2606 OID 26719)
-- Dependencies: 1553 1553
-- Name: curso_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY curso
    ADD CONSTRAINT curso_pkey PRIMARY KEY (cur_idcurso);


--
-- TOC entry 1882 (class 2606 OID 26721)
-- Dependencies: 1554 1554
-- Name: estudiante_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY estudiante
    ADD CONSTRAINT estudiante_pkey PRIMARY KEY (est_codigoestudiante);


--
-- TOC entry 1884 (class 2606 OID 26723)
-- Dependencies: 1555 1555
-- Name: fase_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY fase
    ADD CONSTRAINT fase_pkey PRIMARY KEY (fas_idfase);


--
-- TOC entry 1886 (class 2606 OID 26725)
-- Dependencies: 1556 1556
-- Name: grupotrabajo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY grupotrabajo
    ADD CONSTRAINT grupotrabajo_pkey PRIMARY KEY (grt_idgrupotrabajo);


--
-- TOC entry 1890 (class 2606 OID 26727)
-- Dependencies: 1558 1558
-- Name: key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY metodologia
    ADD CONSTRAINT key PRIMARY KEY (met_id);


--
-- TOC entry 1888 (class 2606 OID 26729)
-- Dependencies: 1557 1557
-- Name: material_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY material
    ADD CONSTRAINT material_pkey PRIMARY KEY (idmaterial);


--
-- TOC entry 1892 (class 2606 OID 26731)
-- Dependencies: 1559 1559
-- Name: modulo_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY modulo
    ADD CONSTRAINT modulo_pkey PRIMARY KEY (mod_idmodulo);


--
-- TOC entry 1894 (class 2606 OID 26733)
-- Dependencies: 1560 1560
-- Name: permiso_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY permiso
    ADD CONSTRAINT permiso_pkey PRIMARY KEY (pem_idpermiso);


--
-- TOC entry 1896 (class 2606 OID 26735)
-- Dependencies: 1561 1561
-- Name: profesor_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY profesor
    ADD CONSTRAINT profesor_pkey PRIMARY KEY (prf_cedulaprofesor);


--
-- TOC entry 1898 (class 2606 OID 26737)
-- Dependencies: 1562 1562
-- Name: reporteentregas_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reporteentregas
    ADD CONSTRAINT reporteentregas_pkey PRIMARY KEY (rpe_idreporte);


--
-- TOC entry 1900 (class 2606 OID 26739)
-- Dependencies: 1563 1563
-- Name: reportenotas_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY reportenotas
    ADD CONSTRAINT reportenotas_pkey PRIMARY KEY (rpn_idreportenotas);


--
-- TOC entry 1902 (class 2606 OID 26741)
-- Dependencies: 1564 1564
-- Name: roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY roles
    ADD CONSTRAINT roles_pkey PRIMARY KEY (rol_idroles);


--
-- TOC entry 1904 (class 2606 OID 26743)
-- Dependencies: 1565 1565
-- Name: tipousuario_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tipousuario
    ADD CONSTRAINT tipousuario_pkey PRIMARY KEY (tpu_id);


--
-- TOC entry 1906 (class 2606 OID 26745)
-- Dependencies: 1566 1566
-- Name: usuario_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY usuario
    ADD CONSTRAINT usuario_pkey PRIMARY KEY (usu_loginusuario);


--
-- TOC entry 1913 (class 2606 OID 26746)
-- Dependencies: 1551 1555 1883
-- Name: actividad_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY actividad
    ADD CONSTRAINT actividad_fk_1 FOREIGN KEY (act_fase) REFERENCES fase(fas_idfase) ON UPDATE CASCADE;


--
-- TOC entry 1914 (class 2606 OID 26751)
-- Dependencies: 1875 1551 1552
-- Name: artefactos_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY artefactos
    ADD CONSTRAINT artefactos_fk_1 FOREIGN KEY (art_actividad) REFERENCES actividad(act_idactividad) ON UPDATE CASCADE;


--
-- TOC entry 1931 (class 2606 OID 26876)
-- Dependencies: 1877 1552 1579
-- Name: configuracioncursoartecfacto_cfc_artefacto_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY configuracioncursoartecfacto
    ADD CONSTRAINT configuracioncursoartecfacto_cfc_artefacto_fkey FOREIGN KEY (cfc_artefacto) REFERENCES artefactos(art_idartefacto) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- TOC entry 1915 (class 2606 OID 26756)
-- Dependencies: 1556 1885 1554
-- Name: estudiante_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estudiante
    ADD CONSTRAINT estudiante_fk_1 FOREIGN KEY (est_grupotrabajo) REFERENCES grupotrabajo(grt_idgrupotrabajo) ON UPDATE CASCADE;


--
-- TOC entry 1916 (class 2606 OID 26761)
-- Dependencies: 1905 1554 1566
-- Name: estudiante_fk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estudiante
    ADD CONSTRAINT estudiante_fk_2 FOREIGN KEY (est_loginusuario) REFERENCES usuario(usu_loginusuario) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- TOC entry 1917 (class 2606 OID 26766)
-- Dependencies: 1553 1554 1879
-- Name: estudiante_fk_3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY estudiante
    ADD CONSTRAINT estudiante_fk_3 FOREIGN KEY (est_cursoestudiante) REFERENCES curso(cur_idcurso) ON UPDATE CASCADE;


--
-- TOC entry 1930 (class 2606 OID 26897)
-- Dependencies: 1875 1578 1551
-- Name: fk_actividad; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY configuracioncursoactividad
    ADD CONSTRAINT fk_actividad FOREIGN KEY (cfc_actividad) REFERENCES actividad(act_idactividad) ON UPDATE CASCADE;


--
-- TOC entry 1932 (class 2606 OID 26881)
-- Dependencies: 1555 1580 1883
-- Name: fk_fase; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY configuracioncursofase
    ADD CONSTRAINT fk_fase FOREIGN KEY (cfc_fase) REFERENCES fase(fas_idfase) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- TOC entry 1918 (class 2606 OID 26771)
-- Dependencies: 1556 1553 1879
-- Name: grupotrabajo_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY grupotrabajo
    ADD CONSTRAINT grupotrabajo_fk_1 FOREIGN KEY (grt_curso) REFERENCES curso(cur_idcurso) ON UPDATE CASCADE;


--
-- TOC entry 1919 (class 2606 OID 26776)
-- Dependencies: 1883 1555 1557
-- Name: material_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY material
    ADD CONSTRAINT material_fk_1 FOREIGN KEY (mat_fasematerial) REFERENCES fase(fas_idfase) ON UPDATE CASCADE;


--
-- TOC entry 1920 (class 2606 OID 26781)
-- Dependencies: 1557 1552 1877
-- Name: material_fk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY material
    ADD CONSTRAINT material_fk_2 FOREIGN KEY (mat_artefactomaterial) REFERENCES artefactos(art_idartefacto) ON UPDATE CASCADE;


--
-- TOC entry 1921 (class 2606 OID 26786)
-- Dependencies: 1557 1551 1875
-- Name: material_fk_3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY material
    ADD CONSTRAINT material_fk_3 FOREIGN KEY (mat_actividad) REFERENCES actividad(act_idactividad) ON UPDATE CASCADE;


--
-- TOC entry 1922 (class 2606 OID 26791)
-- Dependencies: 1559 1891 1560
-- Name: permiso_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY permiso
    ADD CONSTRAINT permiso_fk_1 FOREIGN KEY (pem_modulo) REFERENCES modulo(mod_idmodulo) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1923 (class 2606 OID 26796)
-- Dependencies: 1561 1905 1566
-- Name: profesor_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY profesor
    ADD CONSTRAINT profesor_fk_1 FOREIGN KEY (prf_loginusuario) REFERENCES usuario(usu_loginusuario) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- TOC entry 1924 (class 2606 OID 26801)
-- Dependencies: 1553 1561 1879
-- Name: profesor_fk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY profesor
    ADD CONSTRAINT profesor_fk_2 FOREIGN KEY (prf_cursoprofesor) REFERENCES curso(cur_idcurso) ON UPDATE CASCADE;


--
-- TOC entry 1925 (class 2606 OID 26806)
-- Dependencies: 1885 1556 1562
-- Name: reporteentregas_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reporteentregas
    ADD CONSTRAINT reporteentregas_fk_1 FOREIGN KEY (rpe_grupotrabajo) REFERENCES grupotrabajo(grt_idgrupotrabajo) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1926 (class 2606 OID 26811)
-- Dependencies: 1551 1875 1562
-- Name: reporteentregas_fk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reporteentregas
    ADD CONSTRAINT reporteentregas_fk_2 FOREIGN KEY (rpe_actividad) REFERENCES actividad(act_idactividad) ON UPDATE CASCADE ON DELETE SET DEFAULT;


--
-- TOC entry 1927 (class 2606 OID 26816)
-- Dependencies: 1895 1561 1563
-- Name: reportenotas_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reportenotas
    ADD CONSTRAINT reportenotas_fk_1 FOREIGN KEY (rpn_profesor) REFERENCES profesor(prf_cedulaprofesor) ON UPDATE CASCADE;


--
-- TOC entry 1928 (class 2606 OID 26821)
-- Dependencies: 1556 1885 1563
-- Name: reportenotas_fk_2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reportenotas
    ADD CONSTRAINT reportenotas_fk_2 FOREIGN KEY (rpn_grupotrabajo) REFERENCES grupotrabajo(grt_idgrupotrabajo) ON UPDATE CASCADE;


--
-- TOC entry 1929 (class 2606 OID 26826)
-- Dependencies: 1897 1563 1562
-- Name: reportenotas_fk_3; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY reportenotas
    ADD CONSTRAINT reportenotas_fk_3 FOREIGN KEY (reporteentrega) REFERENCES reporteentregas(rpe_idreporte) ON UPDATE CASCADE;


--
-- TOC entry 1956 (class 0 OID 0)
-- Dependencies: 3
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


-- Completed on 2010-07-15 15:31:36

--
-- PostgreSQL database dump complete
--

